<?php

class Default_Form_Edituser extends Zend_Form
{

    public function init()
    {
        $fullname = new Zend_Form_Element_Text("user_fullname");
        $fullname->setLabel("Họ & Tên")
        ->setRequired(true)
        ->removeDecorator("HtmlTag");
        
        $gender = new Zend_Form_Element_Select("user_gender");
        $gender->setLabel("Giới Tính")
        ->removeDecorator("HtmlTag")
        ->setRequired(true);
        $gender->addMultiOptions(array(
                "Nam" => "Nam",
                "Nữ"  => "Nữ",
        ));
        $image = new Zend_Form_Element_File('user_image');
        $image->setDestination(APPLICATION_PATH .'/../public/default/images/user/')
        ->setLabel('Ảnh đại diện')
        ->addValidator('Size', false, 1024000)
        ->addValidator('Extension', false, 'jpg, ico, jpeg, png')
        ->setMaxFileSize(1024000)
        ->removeDecorator("HtmlTag");
        
        $address = new Zend_Form_Element_Text("user_address");
        $address->setRequired(true)
        ->setLabel("Địa Chỉ")
        ->removeDecorator("HtmlTag");
        
        $phone = new Zend_Form_Element_Text("user_phone");
        $phone->setLabel("Số Điện Thoại")
        ->removeDecorator("HtmlTag")
        ->addFilter("Alnum");
        
        $submit = new Zend_Form_Element_Submit("edit");
        $submit->setLabel("Lưu")
        ->removeDecorator("DtDdWrapper");
        $this->addElements(array($fullname, $gender, $address, $phone, $image,  $submit));
    }


}

